package world.action;

import world.World;

/**
 * defines an action to be performed by a unit
 * <br><br>
 * this class should eventually be modified to be a final clas that only includes static types;
 * this is because methods here can potentially alter the state of the unit in any way, hence
 * to cheat a user could simply delcare a new action and set the units to execute that action
 * @author jack
 *
 */
public abstract class Action
{
	/**
	 * executes the action
	 * @param tdiff
	 * @return returns the amount of time remaining for another action to be executed
	 */
	public abstract double executeAction(double tdiff);
	/**
	 * starts the action, called by the game world when the unit is updated
	 * @param w
	 */
	public abstract void startAction(World w);
	/**
	 * called when the action is canceled, this method gets called if the action
	 * reports that it is not done but the user ai wants to begin a new action
	 * @param w
	 */
	public abstract void cancelAction(World w);
	/**
	 * called when the action is ended, action is ended when the world
	 * detects that the isDone() method returns true
	 * @param w
	 */
	public abstract void endAction(World w);
	public abstract boolean isDone();
}
